﻿namespace CoreEx.MicroMapper
{
    /// <summary>
    /// Represents a class that is capable of accessing any arbitrary object instance.
    /// </summary>
    public interface IAccessor
    {
        /// <summary>
        /// Gets the value from the <paramref name="target"/>
        /// </summary>
        /// <param name="target">A <paramref name="target"/> instance.</param>
        /// <param name="accessorInfo">An <see cref="IAccessorInfo"/> that describes the target accessor.</param>
        /// <returns><see cref="System.Object"/></returns>
        object GetValue(object target, IAccessorInfo accessorInfo);

        /// <summary>
        /// Sets the value on the <paramref name="target"/> accessor.
        /// </summary>
        /// <param name="target">A <paramref name="target"/> instance.</param>
        /// <param name="accessorInfo">An <see cref="IAccessorInfo"/> that describes the target accessor.</param>
        /// <param name="value">The value to set.</param>
        void SetValue(object target, IAccessorInfo accessorInfo, object value);
    }
}